package com.example.mobile2032021606168xmy0615classtest;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private List<Users> list = new ArrayList<>();
    private RecyclerView rvMainUsers;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

//        list.add(new Users(1, "朴灿烈", 29, 98));
//        list.add(new Users(2, "边伯贤", 29, 99));
//        list.add(new Users(2, "吴世勋", 27, 94));
        list = new MyDataAdpater().QueryAll(this);
        rvMainUsers.setAdapter(new UserRViewAdapter(list));

    }


    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tv_main_title);
        rvMainUsers = (RecyclerView) findViewById(R.id.rv_main_users);

        rvMainUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}